/*
 * Copyright 2010 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

addScriptToInject(function() {

// Public configuration constant
chrome_comp.CompDetectorConfig = {
  // Turning it on will give you bug-trace info.
  canTraceBug: true,
  // Indicates whether we want to run the detection tool in onload event
  // or run it later. (delay time is delayRunDetectionTimer.)
  delayRunDetection: true,
  delayRunDetectionTimer: 1000,
  // Disabled Detectors
  disabledDetectors: {
    'InvalidDetector': true
  },
  // if enabledDetectors is not null, it overrides disabledDetectors so that
  // only listed detectors here will be run.
  enabledDetectors: null,
  // enabledDetectors: { 'some_detector_to_debug': true },
  maxProblemsPerType: 10,
  unitTestMode: false
};

if (document.documentElement.hasAttribute('chrome_comp_test')) {
  chrome_comp.CompDetectorConfig.unitTestMode = true;
  chrome_comp.CompDetectorConfig.maxProblemsPerType = 1000;
  var tests = document.documentElement.getAttribute('chrome_comp_test');
  if (tests) {
    tests = tests.split(' ');
    chrome_comp.CompDetectorConfig.enabledDetectors = { };
    for (var i = 0; i < tests.length; i++)
      chrome_comp.CompDetectorConfig.enabledDetectors[tests[i]] = true;
  }
}
});
